#!/usr/bin/perl -w
#
# Copyright(c) Plink Limited 2006. All rights reserved.
#
# $Header:$
#
# $Log:$
# 
# Author:      Jeremy Banks
#
# Description: Clean up old log files
#

#----------------------------------------------------------------------
# External Modules
#----------------------------------------------------------------------

package XMLTV::CacheCleaner;

use strict;

#---------------------------------------------------------------------------
# Globals
#---------------------------------------------------------------------------

my $keep_days = 14;

#---------------------------------------------------------------------------
# Clean
#---------------------------------------------------------------------------

sub clean
{
   my $log_dir = XMLTV::Settings::log_dir();
   for (<$log_dir/*>)
   {
      unlink $_ if $keep_days < -M $_;
   }
}

1;
